import axios from '@/libs/api.request'

export const getSubjectList = (seachParams) => {
  return axios.request({
    url: 'subjects',
    method: 'get',
    params: seachParams
  })
}

export const getSubject = (id) => {
  return axios.request({
    url: 'subjects/' + id,
    method: 'get',
    data: data
  })
}

export const addSubject = (data) => {
  return axios.request({
    url: 'subjects',
    method: 'post',
    data: data
  })
}

export const updateSubject = (data) => {    //去掉id
  return axios.request({
    url: 'subjects',
    method: 'put',
    data: data
  })
}

export const deleteSubject = (id) => {
  return axios.request({
    url: 'subjects/'+id,
    method: 'delete'
  })
}
